function [scheduledTargets, scheduledPriorities, status] = GRASP_Construction(PQ, s1OlTargets, s1OlBins, s2OlTargets, s2OlBins, scheduledTargets, scheduledPriorities)
%GRASP_Construction Summary of this function goes here
%   Detailed explanation goes here
 
randomTargetList = randperm(PQ_Size(PQ));

for p = 1:PQ_Priorities(PQ)
  priority = PQ_Priorities(PQ)+1-p;
    
  for target = 1:size(randomTargetList, 2)
    [Task, status] = PQ_Fetch_Task(PQ, randomTargetList(target), priority);
    if ~status
      continue;
    end
    
    target_id = Task.id;
    if any(scheduledTargets == target_id)
      continue;
    end
    
    [s1ScheduledTargets, s1ScheduledPriorities, status] = GRASP_AddToSolution(target_id, priority, scheduledTargets, scheduledPriorities, s1OlTargets, s1OlBins);
    if ~status
      continue;
    end
    
    [s2ScheduledTargets, s2ScheduledPriorities, status] = GRASP_AddToSolution(target_id, priority, scheduledTargets, scheduledPriorities, s2OlTargets, s2OlBins);
    if ~status
      continue;
    end
    
    [newScheduledTargets, newScheduledPriorities, status] = GRASP_FindMatchingSolution(s1ScheduledTargets, s1ScheduledPriorities, s2ScheduledTargets, s2ScheduledPriorities);
    if ~status
      continue;
    end
    
    scheduledTargets = newScheduledTargets;
    scheduledPriorities = newScheduledPriorities;
  end
end

status = 1;
end %function